document.addEventListener("DOMContentLoaded",function(){

    document.getElementById("backOET").addEventListener("click", function(){

        window.location.href = "../../index.html" 

        
    })

    document.getElementById("backhome").addEventListener("click", function(){

        var mainhtml = document.getElementById("mainhtml")


        document.querySelector('.bottomcontent').removeChild(mainhtml)

   
        var iframe2 = document.createElement('iframe')
        iframe2.src = '../static/html/videoplaza.html'
        iframe2.style.display = 'block';
        iframe2.style.width = '100%'
        iframe2.id = 'mainhtml'
        document.querySelector('.bottomcontent').appendChild(iframe2);
    


     });



     document.getElementById("userLogin").addEventListener("click", function() {

         var iframe = document.createElement('iframe');
         iframe.src = '../static/html/login.html'; // 设置 iframe 的 src 属性为要加载的 HTML 文件的 URL
         // 设置 iframe 样式
         iframe.id = 'userLoginhtml'
         iframe.style.width = '500px';
         iframe.style.height = '500px'; // 设置 iframe 高度，根据需要调整
         iframe.style.border = 'none'; // 去掉 iframe 边框
         iframe.style.position = 'absolute'
         iframe.style.left = '35%'
         iframe.style.top = '10%'
         document.querySelector('.bottomcontent').appendChild(iframe);
     });

     document.getElementById("uploadButton").addEventListener("click",function(){
        
        let uploadhtml= window.parent.document.getElementById('uploadhtml');
        
        if (uploadhtml) {
            uploadhtml.parentNode.removeChild(uploadhtml);
        }

        let iframe = document.createElement('iframe');
        iframe.src = '../static/html/upload.html'; // 设置 iframe 的 src 属性为要加载的 HTML 文件的 URL
        // 设置 iframe 样式
        iframe.id = 'uploadhtml'
        iframe.style.width = '400px';
        iframe.style.height = '500px'; // 设置 iframe 高度，根据需要调整
        iframe.style.border = 'none'; // 去掉 iframe 边框
        iframe.style.position = 'absolute'
        iframe.style.left = '40%'
        iframe.style.top = '15%'
        document.querySelector('.bottomcontent').appendChild(iframe);

     })
})